package com.example.demo2.service;

import com.example.demo2.bean.Travel;
import com.example.demo2.dao.TravelDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TravelService {

    @Autowired
    TravelDao dao;

    public List<Travel> list(){
        List<Travel> all = dao.findAll();
        return all;
    }

//    public Travel login(Travel yourBean) {
//        Travel yourBean1 = dao.findOne(Example.of(yourBean)).orElse(null);
//        return yourBean1;
//    }
//
//    public Travel register(Travel yourBean) {
//        Travel save = dao.save(yourBean);
//        return save;
//    }
//
//    public Travel findone(Travel yourBean) {
//        Travel yourBean1 = dao.findOne(Example.of(yourBean)).orElse(null);
//        return yourBean1;
//    }
//
//    public void deleteById(Integer id) {
//        dao.deleteById(id);
//    }
//
//    public Travel update(Travel yourBean) {
//        Travel save = dao.save(yourBean);
//        return save;
//    }
//
//    public Travel addone(Travel yourBean) {
//        Travel save = dao.save(yourBean);
//        return save;
//    }
}
